package com.neusoft.yiyang.care.service.impl;

import com.neusoft.yiyang.common.entity.care.CareLevelItem;
import com.neusoft.yiyang.care.mapper.CareLevelItemMapper;
import com.neusoft.yiyang.care.service.CareLevelItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CareLevelItemServiceImpl implements CareLevelItemService {

    @Autowired
    private CareLevelItemMapper careLevelItemMapper;

    @Override
    public List<CareLevelItem> getCareLevelItemsByCareLevelId(Integer careLevelId) {
        return careLevelItemMapper.selectListByCareLevelId(careLevelId);
    }

    @Override
    public List<CareLevelItem> getCareLevelItemsByCareItemId(Integer careItemId) {
        return careLevelItemMapper.selectListByCareItemId(careItemId);
    }

    @Override
    public void addCareLevelItem(CareLevelItem careLevelItem) {
        careLevelItemMapper.insert(careLevelItem);
    }

    @Override
    public void deleteCareLevelItem(Integer careLevelId, Integer careItemId) {
        careLevelItemMapper.deleteByCareLevelAndCareItem(careLevelId, careItemId);
    }
}
